#include <stdio.h>
#define N 10
int a[N] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int *p = &a[0], *q = &a[N-1], temp;
int main(void)
{
    while (p < q) {
        temp = *p;
        *p++ = *q;
        *q-- = temp;
    }
    for (int *i = a; i < a + N; i++)
        printf("%d%c", *i, i < a + N - 1 ? ' ' : '\n');
    return 0;
}